package com.promise.jokerdream.database.entity

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
import kotlinx.serialization.Serializable

/**
 * 江湖长梦配置实体 - 独立的完整表
 */
@Serializable
@Entity(
    tableName = "knight_dream_game_config",
    foreignKeys = [
        ForeignKey(
            entity = UserConfigEntity::class,
            parentColumns = ["userId"],
            childColumns = ["userId"],
            onDelete = ForeignKey.CASCADE
        )
    ],
    indices = [Index(value = ["userId"], unique = true)]
)
data class KnightDreamGameConfigEntity(
    @PrimaryKey
    val userId: String,
    val enabledSetting: Boolean = true,
    val scheduledChallengeEnabled: Boolean = false,
    val registrationTime: String = "",
    val priority: String = "ADVENTURE", // KnightDreamPriority enum
    val selectedDungeonId: Int = 0,
    val challengeCount: Int = 9999
)

